package com.ej.demo.page;

import com.thoughtworks.selenium.Selenium;

public class HomePage {

	// DOM Target Value variables
	private String orginAirport = "label=London (All Airports)";
	private String destinationAirport = "label=Barcelona (BCN)";
	private String startDate = "label=21";
	private String returnDate = "label=28";
	private String startMonthYear = "label=November 2009";
	private String returnMonthYear = "label=November 2009";
	private String adults = "label=2";
	private String kids = "label=1";
	private String infants = "label=1";
	private Selenium selenium;

	public HomePage() {
		selenium = eJTestBase.getSeleniumObj();
	}

	public void navigateToFlightListingPage() {

		selenium.click("btn_submitForm");
		selenium.getConfirmation();
		selenium.waitForPageToLoad("90000");

	}

	public void enterJourneyDetails(String orgin, String destination,
			String onwardDate, String onwardMonth, String returnDate2,
			String returnMonth) {

		selenium.select("orig", orginAirport);
		selenium.select("dest", destinationAirport);
		selenium.select("oDay", startDate);
		selenium.select("oMonYear", startMonthYear);
		selenium.select("rDay", returnDate);
		selenium.select("rMonYear", returnMonthYear);
	}

	public void enterPassengerDetails(String numberOfAdults,
			String numberOfKids, String numberOfInfants) {
		selenium.select("numOfAdults", adults);
		selenium.select("numOfKids", kids);
		selenium.select("numOfInfants", infants);
	}

}
